<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>My JSP 'register.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<!--<script type="text/javascript">
	function validate(){
	var usernameValue=document.getElementById("register_username").value;
	var passwordValue=document.getElementById("register_password").value;
	var repasswordValue=document.getElementById("register_repassword").value;
	
	if(usernameValue.length==0){
	alert("用户名不能为空！");
	return false;
	}else if(usernameValue.length<6||usernameValue.length>10){
	alert("用户名应该在6到10之间！");
	return false;
	}
	if(passwordValue.length==0){
	alert("密码不能为空！");
	return false;
	}else if(passwordValue.length<6||passwordValue.length>10){
	alert("密码应该在6到10之间！");
	return false;
	}
	if(repasswordValue.length==0){
	alert("确认密码不能为空！");
	return false;
	}else if(repasswordValue.length<6||repasswordValue.length>10){
	alert("确认密码应该在6到10之间！");
	return false;
	}
	if(passwordValue!=repasswordValue){
	alert("两次输入密码不一致！");
	return false;
	}
	return true;
	}
	</script>-->
	</head>
	<body>
		<table align="center" width="40%">
			<tr>
				<td>
					<s:fielderror cssStyle="color:red;"/>
					<!--<s:actionerror cssStyle="color:red;" />-->
				</td>
			</tr>
		</table>
		<!--  -->
		<s:form action="register" theme="simple" onsubmit="return validate();">
			<table align="center" width="40%" border="1">
				<tr>
					<td>
						用户名：
					</td>
					<td>
						<s:textfield name="username" label="用户名"></s:textfield>
					</td>
				</tr>
				<tr>
					<td>
						密码：
					</td>
					<td>
						<s:password name="password" label="密码"></s:password>
					</td>
				</tr>
				<tr>
					<td>
						确认密码：
					</td>
					<td>
						<s:password name="repassword" label="确认密码"></s:password>
					</td>
				</tr>
				<tr>
					<td>
						年龄：
					</td>
					<td>
						<s:textfield name="age" label="年龄"></s:textfield>
					</td>
				</tr>
				<tr>
					<td>
						出生日期：
					</td>
					<td>
						<s:textfield name="birthday" label="出生日期"></s:textfield>
					</td>
				</tr>
				<tr>
					<td>
						毕业日期：
					</td>
					<td>
						<s:textfield name="graduation" label="毕业日期"></s:textfield>
					</td>
				</tr>
				<tr>
					<td>
						<s:submit value="注册" />
					</td>
					<td>
						<s:reset value="重置" />
					</td>
				</tr>
			</table>
		</s:form>
	</body>
</html>
